import ToolRequest from '@/base/newToolAxios';
import RequestOption from '@/base/RequestOption';
import { getActToolUrl } from '@/base/constant';

const tr = new ToolRequest();

export default class major_dao {
  /**
   * 获取专业数据
   * @returns
   */
  async listAll() {
    const ro = new RequestOption();
    return await tr.get(
      getActToolUrl(),
      {
        action: 'listAll'
      },
      ro
    );
  }

  /**
   * 修改专业为禁用状态
   * @returns 
   */
  async disabledMajor(majorCode: any) {
    const ro = new RequestOption();
    return await tr.post(
      getActToolUrl(),
      {
        action: 'disabledMajor',
        majorCode: majorCode
      },
      ro
    );
  }

   /**
   * 取消专业的禁用状态
   * @returns 
   */
   async unDisabledMajor(majorCode: any) {
    const ro = new RequestOption();
    return await tr.post(
      getActToolUrl(),
      {
        action: 'unDisabledMajor',
        majorCode: majorCode
      },
      ro
    );
  }
}
